package com.zsl.blog.api.controller;

import com.zsl.blog.api.dao.pojo.SysUser;
import com.zsl.blog.api.service.SysUserService;
import com.zsl.blog.api.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
*@Description:获取用户信息
* @param null
*@Return:
*@Data:2022/11/20 17:54
*@Author:zhaosilong
*/
@RequestMapping("/users")
@RestController
public class UserController {

    @Autowired
    private SysUserService sysUserService;

    @GetMapping("/currentUser")
    public Result currentUser(@RequestHeader("Authorization") String token){
        return sysUserService.findUserByToken(token);
    }

}
